class HeadRenderer : public IBlockRenderer
{
public:
	ITexture *Texture;

	HeadRenderer(ITexture *texture) :
		Texture(texture)
	{
	}

	int GetTypeData(const int &data) { return data; }

	void Render(Schematic *schematic, RendererBase *renderer, const Block &block, const Point3i &position)
	{
		switch (block.Data)
		{
		case 1:
			{
				renderer->Translate(8, 8, 8);
				auto rot = schematic->GetTileEntity(position)->Find("Rot")->As<NBTTagValue<byte>>()->Value;
				renderer->Rotate(-180 - ((rot * (1 / 16.0f)) * 360), 0, 1, 0);
				renderer->Translate(-8, -8, -8);

				renderer->Draw(Box(Texture, Point3i(8, 8, 8), Point3i(4, 4, 4)).Unwrap(Point2i(8, 8)));
			}
			break;
		case 2:
			renderer->Translate(8, 8, 8);
			renderer->Rotate(180, 0, 1, 0);
			renderer->Translate(-8, -8, -8);
			renderer->Draw(Box(Texture, Point3i(8, 8, 8), Point3i(4, 4, 0)).Unwrap(Point2i(8, 8)));
			break;
		case 3:
			renderer->Draw(Box(Texture, Point3i(8, 8, 8), Point3i(4, 4, 0)).Unwrap(Point2i(8, 8)));
			break;
		case 4:
			renderer->Translate(8, 8, 8);
			renderer->Rotate(-90, 0, 1, 0);
			renderer->Translate(-8, -8, -8);
			renderer->Draw(Box(Texture, Point3i(8, 8, 8), Point3i(4, 4, 0)).Unwrap(Point2i(8, 8)));
			break;
		case 5:
			renderer->Translate(8, 8, 8);
			renderer->Rotate(90, 0, 1, 0);
			renderer->Translate(-8, -8, -8);
			renderer->Draw(Box(Texture, Point3i(8, 8, 8), Point3i(4, 4, 0)).Unwrap(Point2i(8, 8)));
			break;
		}
	}
};